package com.nuc.bigdata.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nuc.bigdata.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * @author JackLuo
 * @date 2019/10/18
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "user")
public class User extends BaseEntity implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField
    @NotEmpty(message = "用户Id不为空")
    private String userId;

    @TableField
    @Length(max = 10)
    private String loginName;

    @TableField
    @Length(max = 50)
    private String email;

    @TableField
    @Length(max = 11)
    private String phoneNumber;

    @TableField
    @NotEmpty(message = "密码不能为空")
    @Length(max = 30,min = 6)
    private String password;

    @TableField
    private Long role;

    @TableField
    private Long sex;

    @TableField
    @Length(max = 200)
    private String headPicture;

    @TableField
    @Length(max = 200)
    private String tag;

    @TableField
    private Date birthday;

    @TableField
    @Length(max = 200)
    private String location;
}
